# fpath="D:\ProgramFiles\pythonworkplace\LGN\data\CCIRCupdecode.txt"
# csvfpath="D:\pydataset\CCIRCup\submit_LGN2.csv"
decodefpath="D:\ProgramFiles\pythonworkplace\LexiconAugmentedNER\embeddings\CCIRCupdecode.txt"
csvfpath="D:\pydataset\CCIRCup\submit_LexiconAugmentedNER2.csv"

with open(decodefpath,"r",encoding='utf-8') as r:
    with open(csvfpath,"w",encoding='utf-8') as w:
        w.write('id,tag\n')
        id = 0
        for line in r:
            if len(line)>1:
                line = line.split()
                w.write(str(id)+','+line[1]+'\n')
                id+=1
            else:
                w.write(',\n')